package com.syg.service;

import com.syg.dao.datasource.DataSourceEnum;
import com.syg.dao.datasource.DataSourceSwitcher;
import com.syg.dao.mapper.OrderMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderService {

    @Resource
    private OrderMapper orderMapper;


    /**
     * 读操作
     *
     * @param orderId
     * @return
     */
    @DataSourceSwitcher(DataSourceEnum.SLAVER)
    public List getOrder(String orderId) {
        // return orderMapper.listOrders(orderId);
        return null;

    }

    /**
     * 写操作
     *
     * @param orderId
     * @return
     */
    @DataSourceSwitcher(DataSourceEnum.MASTER)
    public List insertOrder(Long orderId) {
        // Order order = new Order();
        // order.setOrderId(orderId);
        // return orderMapper.saveOrder(order);
        return null;
    }
}
